<template>
  <el-menu default-active="2" mode="vertical" :collapse="collapsed" collapse-transition router :default-active="$route.path" unique-opened class="el-menu-vertical-demo" background-color="#334157" text-color="#fff" active-text-color="#ffd04b">
      <el-submenu v-for="(menu,index) in allmenu" :index="menu.menuname" :key="index">
        <template slot="title">
          <p v-on:click="goPage(menu.route)">{{menu.menuname}}</p>
        </template>
		</el-submenu>
    </el-menu>
</template>

<script type="text/babel">
  export default {
	  name:'leftNav', 
    data() {
      return {
        collapsed:false,
		allmenu:[
			{
				menuname:'柱状图',
				route:'zhuzhuang'
			},
			{
				menuname:'折线图',
				route:'zhexian'
			},
			{
				menuname:'饼图',
				route:'bing'
			},
			{
				menuname:'雷达图',
				route:'leida'
			},
		]
      };
	},
	mounted() {
			
		
	},
    methods: {
		goPage(route) {
			this.$router.push({name:route})
		}
    }
  }
</script>

<style scoped rel="stylesheet/less" lang="less">
.el-menu-vertical-demo:not(.el-menu--collapse) {
  width: 15vw;
  min-height: 100vh;
  display: inline-block;
  min-width:250px;
}
.el-menu-vertical-demo:not(.el-menu--collapse) {
  border: none;
  text-align: left;
}
.el-menu-item-group__title {
  padding: 0px;
}
.el-menu-bg {
  background-color: #1f2d3d !important;
}
.el-menu {
  border: none;
}
.logobox {
  height: 40px;
  line-height: 40px;
  color: #9d9d9d;
  font-size: 20px;
  text-align: center;
  padding: 20px 0px;
}
.logoimg {
  height: 40px;
}
</style>
